import axios from '@/utils/request'
/**
 *我的频道数据接口
 * @returns
 */
export const getUserChannels = () =>
  axios({
    url: '/v1_0/user/channels'
  })

/**
 * 获取所有的频道信息
 */
export const getAllChannels = () => {
  return axios({
    method: 'get',
    url: '/v1_0/channels'
  })
}

// 本地频道储存  增加接口
export const addchannel = (channels) =>
  axios({
    method: 'PATCH',
    url: '/v1_0/user/channels',
    data: {
      channels
    }
  })

export const delchannel = (target) =>
  axios({
    method: 'DELETE',
    url: '/v1_0/user/channels/' + target
  })
